/*
 Navicat Premium Data Transfer

 Source Server         : test1
 Source Server Type    : MySQL
 Source Server Version : 50719
 Source Host           : localhost
 Source Database       : starSurvey

 Target Server Type    : MySQL
 Target Server Version : 50719
 File Encoding         : utf-8

 Date: 12/24/2017 18:16:41 PM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `t_answer`
-- ----------------------------
DROP TABLE IF EXISTS `t_answer`;
CREATE TABLE `t_answer` (
  `answer_id` int(255) NOT NULL AUTO_INCREMENT,
  `survey_questionId` int(255) DEFAULT NULL,
  `answer_infor` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`answer_id`),
  KEY `survey_questionId` (`survey_questionId`),
  CONSTRAINT `t_answer_ibfk_1` FOREIGN KEY (`survey_questionId`) REFERENCES `t_question` (`survey_questionId`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `t_answer`
-- ----------------------------
BEGIN;
INSERT INTO `t_answer` VALUES ('1', '3', '测试写入情况');
COMMIT;

-- ----------------------------
--  Table structure for `t_question`
-- ----------------------------
DROP TABLE IF EXISTS `t_question`;
CREATE TABLE `t_question` (
  `survey_questionId` int(255) NOT NULL AUTO_INCREMENT,
  `survey_questionName` varchar(255) DEFAULT NULL,
  `survey_questionType` int(11) DEFAULT NULL,
  `survey_id` int(255) DEFAULT NULL,
  `survey_questionSingleA` varchar(255) DEFAULT NULL,
  `survey_singleACount` int(255) DEFAULT '0',
  `survey_questionSingleB` varchar(255) DEFAULT NULL,
  `survey_singleBCount` int(255) DEFAULT '0',
  `survey_questionSingleC` varchar(255) DEFAULT NULL,
  `survey_singleCCount` int(255) DEFAULT '0',
  `survey_questionAnswer` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`survey_questionId`),
  KEY `survey_id` (`survey_id`),
  CONSTRAINT `t_question_ibfk_1` FOREIGN KEY (`survey_id`) REFERENCES `t_survey` (`survey_Id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `t_question`
-- ----------------------------
BEGIN;
INSERT INTO `t_question` VALUES ('1', '完成情况', '1', '5', '一半', '0', '80％', '0', '40％', '0', null), ('2', '测试1', '1', '4', 'A选项', '4', 'B选项', '2', 'C选项', '5', null), ('3', '个人建议', '2', '4', '', '0', '', '0', '', '0', ''), ('5', '本班级人数情况', '1', '4', '30人', '4', '40人', '1', '50人', '4', null);
COMMIT;

-- ----------------------------
--  Table structure for `t_survey`
-- ----------------------------
DROP TABLE IF EXISTS `t_survey`;
CREATE TABLE `t_survey` (
  `survey_Id` int(11) NOT NULL AUTO_INCREMENT,
  `survey_Name` varchar(255) DEFAULT NULL,
  `survey_StartTime` varchar(255) DEFAULT NULL,
  `survey_EndTime` varchar(255) DEFAULT NULL,
  `survey_State` int(11) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `survey_Other` varchar(255) DEFAULT NULL,
  `survey_Statistics` int(255) DEFAULT NULL,
  PRIMARY KEY (`survey_Id`),
  KEY `user_name` (`user_name`),
  CONSTRAINT `t_survey_ibfk_1` FOREIGN KEY (`user_name`) REFERENCES `t_user` (`user_name`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `t_survey`
-- ----------------------------
BEGIN;
INSERT INTO `t_survey` VALUES ('3', '作业满意度', '2017-12-08 19:45:52', '2017-12-16 19:50:45', '1', 'admin', 'sadfasfdsdsafa', null), ('4', '人数情况', '2017-12-08 19:47:23', '2017-12-09 14:30:08', '1', 'admin', '65465撒打发斯蒂芬', '5'), ('5', '作业完成情况', '2017-12-08 20:09:51', '2017-12-09 05:10:39', '1', 'yangshouzhi', '阿斯顿发生大法师', null), ('6', '作业完成情况', '2017-12-08 20:13:21', '2017-12-09 13:25:10', '1', 'yang', '接口我奇偶奇偶及', null), ('7', '测试添加问题', '2017-12-10 21:00:23', '2017-12-13 05:30:07', '1', 'admin', '无', null), ('8', '测试添加问题2', '2017-12-10 21:01:25', '2017-12-13 05:30:17', '1', 'admin', '', null);
COMMIT;

-- ----------------------------
--  Table structure for `t_user`
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(255) DEFAULT NULL,
  `user_password` varchar(255) DEFAULT NULL,
  `user_age` int(11) DEFAULT NULL,
  `user_photo` varchar(255) DEFAULT NULL,
  `user_root` int(2) DEFAULT '0',
  PRIMARY KEY (`user_id`),
  KEY `user_name` (`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `t_user`
-- ----------------------------
BEGIN;
INSERT INTO `t_user` VALUES ('1', 'admin', 'admin', '20', null, '1'), ('2', '123', '123', '18', null, '0'), ('8', '22', '123', '12', null, '0'), ('11', '1', '1', '19', 'png', '0'), ('12', 'yangshouzhi', '123', '19', 'jpg', '0'), ('13', 'yang', '123', '19', 'jpg', '0');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
